#include <iostream>
using namespace std;

int score(int a,int b,int c)
{
    return a+b+c;
}


struct student
{
    string name;
    int Chinese;
    int Statistic;
    int English;
}stu[10] = {{"stu1",90,80,89},{"stu2",95,88,89},{"stu3",90,86,89},{"stu4",88,88,88},
            {"stu5",96,82,84},{"stu6",99,92,86},{"stu7",98,97,86},{"stu8",92,96,88},
            {"stu9",98,82,89},{"stu10",79,80,81}};

int max()
{
    int max=0;
    int i;
    int j;
    int k=0;
    for(i=0;i<10;i++)
    {
        int grade;
        grade=score(stu[i].Chinese,stu[i].Statistic,stu[i].English);
        if(grade>max)
        {
            max=grade;
            j=i;
        }
        if(grade=max)
        {

        }
    }
    cout<<"学生"<<stu[j].name<<"的成绩最低为："<<max<<endl;
    
}
int min()
{
    int min=1000;
    int i;
    int j;
    for(i=0;i<10;i++)
    {
        int grade;
        grade=score(stu[i].Chinese,stu[i].Statistic,stu[i].English);
        if(grade<min)
        {
            min=grade;
            j=i;
        }
    }
    cout<<"学生"<<stu[j].name<<"的成绩最高为："<<min<<endl;
    
}
int average()
{
    float sum1=0;
    float sum2=0;
    float sum3=0;
    
    for(int i=0;i<10;i++)
    {
        sum1+=stu[i].Chinese;
        sum2+=stu[i].Statistic;
        sum3+=stu[i].English;

    }
    cout<<"语文单科平均成绩："<<float(sum1/10)<<endl;
    cout<<"数据单科平均成绩："<<float(sum2/10)<<endl;
    cout<<"英语单科平均成绩："<<float(sum3/10)<<endl;

}

int main()
{
    for(int i=0;i<10;i++)
    {
        cout<<"学生"<<stu[i].name<<"的总成绩："<<score(stu[i].Chinese,stu[i].Statistic,stu[i].English)<<endl;
    }
    average();
    max();
    min();
    
}